<script>
    let product = {
        price: 10,
        quantity: 2
    }

    const proxyProduct = new Proxy(product, {
        set(target, key, value, receiver) {
            console.log('set');
            
            target[key] = value;
            effect();
        },
        get(target, key, receiver) { 
            console.log('get');
            
            return target[key] 
        }
    })

    let total = 0
    let effect = () => { total = proxyProduct.price * proxyProduct.quantity }

    
</script>